<template>
	<view class="wrap">
		<u-card :show-head="false" :show-foot="false" margin="10rpx">
		<view slot="body">
			<u-row gutter="16">
				<u-col span="12">
					<u-section color="#5DADE2" :title="model==='GROUP'?'群签到提醒':'会议签到提醒'" font-size="50" sub-title='' :arrow="false"></u-section>
				</u-col>
			</u-row>
			<u-row gutter="16" style="margin-top: 20px;">
				<u-col span="12">
					<view style="line-height: 50rpx;">
						<view>
							<text style="font-size: 35rpx;font-weight: bold;">标题：</text>
							<text style="color: gray;font-size: 30rpx;">{{model.title}}</text>
						</view>
						<view>
							<text style="font-size: 35rpx;font-weight: bold;">时间范围:</text>
							</br>
							<text style="color: gray;font-size: 30rpx;">
								{{model.startTime}}~
								{{model.endTime}}
							</text>
						</view>
						<view  v-if="model.signStatus===1">
							<text style="font-size: 35rpx;font-weight: bold;">签到时间：</text>
							<text style="color: gray;font-size: 30rpx;">{{model.signTime}}</text>
						</view>
						<view style="color:gray;font-size: 35rpx;margin-top: 30rpx;" v-if="model.signStatus===0">
							您未签到，点击
							<u-button shape="circle" size="medium" type="primary" @click="handleSignin(model)">
								完成签到
							</u-button>
						</view>
						<view style="color:gray;font-size: 35rpx;margin-top: 30rpx;" v-else>
							<u-tag text="已签到" type="success" />
						</view>
					</view>
				</u-col>
			</u-row>
		</view>
		</u-card>
	</view>
</template>
<script>
	/**
	 * @property {Stringr | Number} id 主键ID
	 * @property {Stringr} modeProp 模式（view、eidit、add）外部传入的属性
	 */
	export default {
		data() {
			return {
				model: {
					
				},
			};
		},
		beforeCreate(){
			// console.log("0.beforeCreate...");
		},
		onLoad(params) {
			// console.log("1.onLoad...");
			this.initData(params);
		},
		created() {
			
		},
		onReady() {
			
		},
		beforeMount(){
			// console.log("beforeMount...");
		},
		mounted(){
			// console.log("4.mounted...");
		},
		methods: {
			initData(params){
				this.$u.api.wechat.wechatSigninUser.detail({
					signinId: params.signinId
				}).then(res => {
					if(res.success){
						this.model=res.data;
					}
				});
			},
			handleSignin(row){
				this.$u.api.wechat.wechatSigninUser.save({
					id: row.signinId
				}).then(res => {
					if (res.success) {
						this.initData({signinId:row.signinId});
						uni.showToast({title:"签到成功!",duration:1000})
					}
				});
			},
			
		}
	};
</script>
<style lang="scss" scoped>
	.wrap {
		padding: 30rpx;
	}

	.uTagStyle {
		margin-right: 10rpx;
	}

	.scroll-Y {
		height: 200rpx;
	}

	/deep/ ::-webkit-scrollbar {
		/*滚动条整体样式*/
		width: 4px !important;
		height: 1px !important;
		overflow: auto !important;
		background: #ccc !important;
		-webkit-appearance: auto !important;
		display: block;
	}

	/deep/ ::-webkit-scrollbar-thumb {
		/*滚动条里面小方块*/
		border-radius: 10px !important;
		box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2) !important;
		background: #7b7979 !important;
	}

	/deep/ ::-webkit-scrollbar-track {
		/*滚动条里面轨道*/
		background: #FFFFFF !important;
	}
</style>